﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace DefaultThemes {
    public class ThemeService {
        static public ResourceDictionary GetThemeResource(string themeName) {
            var tn = (ThemeName)Enum.Parse(typeof(ThemeName),themeName,true);
            var rd = new ResourceDictionary();
            switch (tn) {
                case ThemeName.BubbleCreme:
                rd = XamlReader.Load(Properties.Resource.BubbleCreme) as ResourceDictionary;
                break;
                case ThemeName.BureauBlack:
                rd = XamlReader.Load(Properties.Resource.BureauBlack) as ResourceDictionary;
                break;
                case ThemeName.BureauBlue:
                rd = XamlReader.Load(Properties.Resource.BureauBlue) as ResourceDictionary;
                break;
                case ThemeName.ExpressionDark:
                rd = XamlReader.Load(Properties.Resource.ExpressionDark) as ResourceDictionary;
                break;
                case ThemeName.ExpressionLight:
                rd = XamlReader.Load(Properties.Resource.ExpressionLight) as ResourceDictionary;
                break;
                case ThemeName.RainierOrange:
                rd = XamlReader.Load(Properties.Resource.RainierOrange) as ResourceDictionary;
                break;
                case ThemeName.RainierPurple:
                rd = XamlReader.Load(Properties.Resource.RainierPurple) as ResourceDictionary;
                break;
                case ThemeName.ShinyBlue:
                rd = XamlReader.Load(Properties.Resource.ShinyBlue) as ResourceDictionary;
                break;
                case ThemeName.ShinyRed:
                rd = XamlReader.Load(Properties.Resource.ShinyRed) as ResourceDictionary;
                break;
                case ThemeName.SystemColors:
                rd = XamlReader.Load(Properties.Resource.SystemColors) as ResourceDictionary;
                break;
                case ThemeName.TwilightBlue:
                rd = XamlReader.Load(Properties.Resource.TwilightBlue) as ResourceDictionary;
                break;
                case ThemeName.WhistlerBlue:
                rd = XamlReader.Load(Properties.Resource.WhistlerBlue) as ResourceDictionary;
                break;
                case ThemeName.MetroDesign:
                rd = XamlReader.Load(Properties.Resource.MetroDesign) as ResourceDictionary;
                break;
                default:
                break;
            }
            //rd.Source = new Uri(string.Format("/DefaultThemes;component/Theme/{0}.xaml",themeName),UriKind.Relative);
            return rd;
        }
        static public string[] GetThemeNames() {
            return new[] { 
                ThemeName.BubbleCreme.ToString(),
                ThemeName.BureauBlack.ToString(),
                ThemeName.BureauBlue.ToString(),
                ThemeName.ExpressionDark.ToString(),
                ThemeName.ExpressionLight.ToString(),
                ThemeName.MetroDesign.ToString(),
                ThemeName.RainierOrange.ToString(),
                ThemeName.RainierPurple.ToString(),
                ThemeName.ShinyBlue.ToString(),
                ThemeName.ShinyRed.ToString(),
                ThemeName.SystemColors.ToString(),
                ThemeName.TwilightBlue.ToString(),
                ThemeName.WhistlerBlue.ToString(),
            };
        }
    }
    public enum ThemeName {
        BubbleCreme, BureauBlack, BureauBlue, ExpressionDark, ExpressionLight, RainierOrange, RainierPurple, ShinyBlue, ShinyRed, SystemColors, TwilightBlue, WhistlerBlue, MetroDesign
    }
}
